{{!
  Copyright (c) HashiCorp, Inc.
  SPDX-License-Identifier: BUSL-1.1
}}

{{#if (gt @mounts.length 1)}}
  {{! render dropdown of mount paths }}
  <Hds::Form::Select::Field name="path" data-test-select="path" as |F|>
    <F.Label>Mount path</F.Label>
    <F.Options>
      {{#each @mounts as |mount|}}
        <option value={{mount.path}}>{{mount.path}}</option>
      {{/each}}
    </F.Options>
  </Hds::Form::Select::Field>
{{else}}
  {{! render a single mount path }}
  {{#let (get @mounts "0") as |mount|}}
    {{#unless @hideType}}
      <Hds::Text::Body @tag="p" @weight="semibold" data-test-auth-method={{mount.type}}>
        {{auth-display-name mount.type}}
      </Hds::Text::Body>
    {{/unless}}
    {{#if mount.description}}
      <Hds::Text::Body @tag="p" @color="faint" data-test-description>{{mount.description}}</Hds::Text::Body>
    {{/if}}
    {{! the token auth method does't support custom paths so no need to render an input }}
    {{#if @shouldRenderPath}}
      {{! path is hidden so it is submitted with FormData but does not clutter the login form }}
      <input type="hidden" id="path" name="path" value={{mount.path}} data-test-input="path" />
    {{/if}}
  {{/let}}
{{/if}}